package pixeleditor.ctrl;

import java.util.HashMap;
import java.util.Map;

import common.ctrl.IObserver;

import pixeleditor.ctrl.impl.ChooseBackgroundCtrl;
import pixeleditor.ctrl.impl.ChooseBackgroundDialogCtrl;
import pixeleditor.ctrl.impl.ChooseBrushSizeCtrl;
import pixeleditor.ctrl.impl.ChooseColorCtrl;
import pixeleditor.ctrl.impl.ChooseDestructibleCtrl;
import pixeleditor.ctrl.impl.ChooseModeCtrl;
import pixeleditor.ctrl.impl.ChoosePlayerCtrl;
import pixeleditor.ctrl.impl.GridCtrl;
import pixeleditor.ctrl.impl.MenuCtrl;



public class ControlFactory {

	public final static String MENU_CTRL = "menu";
	public final static String GRID_CTRL = "grid";
	public final static String CHOOSE_COLOR_CTRL = "color";
	public final static String CHOOSE_DESTRUCTIBLE_CTRL = "destructible";
	public final static String CHOOSE_BRUSH_SIZE_CTRL = "brush";
	public final static String CHOOSE_BACKGROUND_DIALOG_CTRL = "backgroundD";
	public final static String CHOOSE_BACKGROUND_CTRL = "background";
	public final static String CHOOSE_MODE_CTRL = "mode";
	public final static String CHOOSE_PLAYER_CTRL = "player";

	private static Map<String, IObserver> map = new HashMap<String, IObserver>();
	static { 
		map.put(MENU_CTRL, new MenuCtrl());
		map.put(GRID_CTRL, new GridCtrl());
		map.put(CHOOSE_COLOR_CTRL, new ChooseColorCtrl());
		map.put(CHOOSE_DESTRUCTIBLE_CTRL, new ChooseDestructibleCtrl());
		map.put(CHOOSE_BRUSH_SIZE_CTRL, new ChooseBrushSizeCtrl());
		map.put(CHOOSE_BACKGROUND_DIALOG_CTRL, new ChooseBackgroundDialogCtrl());
		map.put(CHOOSE_BACKGROUND_CTRL, new ChooseBackgroundCtrl());
		map.put(CHOOSE_MODE_CTRL, new ChooseModeCtrl());
		map.put(CHOOSE_PLAYER_CTRL, new ChoosePlayerCtrl());
	}

	public static IObserver getControl(String name) {
		return map.get(name);
	}
}
